package com.byl.modules.wx.gzh.utils;

/**
 * Created by Administrator on 2019/9/19.
 */
public final class ApiConstant {
    private String token="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=";

    private String add_news="https://api.weixin.qq.com/cgi-bin/material/add_news?access_token=";
    public static ApiConstant instance=null;

    private  ApiConstant(){
    }

    public static ApiConstant getInstance(){
        if(null==instance){
            instance=new ApiConstant();
        }
        return instance;
    }

    /**
     * post 请求
     * @param token 访问令牌
     * @return  新增永久图文素材的接口
     */
    public String getAdd_news(String token) {
        return add_news;
    }

    /**
     *  get请求
     * @param appid 公众号appid
     * @param secret 公众号secret秘钥
     * @return 公众号获取access_token的接口
     */
    public String getToken(String appid,String secret) {
        return token+appid+"&secret="+secret;
    }
}
